﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DBManager.aspx.cs" Inherits="Directory.Web.Admin_DBManager" Theme="Admin_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>数据库管理</title>
    <script type="text/javascript">
    	function confirmUpload(objId) {
    		var bakname = document.getElementById(objId).value;
    		return (confirm('新上传备份将覆盖原有备份：' + bakname + '，是否继续上传？'));
    	}
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
		<div class="pageheader">
			<span style="color:Red;">数据库管理&nbsp; &nbsp; &nbsp;进行删除、更新操作时请先做好备份</span>
			<DirectoryControl:Manual ID="Manual1" runat="server">
				备份文件为：DBbak_1.bak、DBbak_2.bak、DBbak_3.bak<br /><br />
				每个备份文件相互独立<br /><br />
				进行备份（或恢复备份）操作前请选择好备份文件<br />
			</DirectoryControl:Manual>
		</div>
		<div class="pagecontent">
			<p>
				选择备份文件：
				<asp:DropDownList ID="ddlBackUpName" runat="server">
					<asp:ListItem Text="DBbak_1" Value="DBbak_1.bak" Selected="True"></asp:ListItem>
					<asp:ListItem Text="DBbak_2" Value="DBbak_2.bak"></asp:ListItem>
					<asp:ListItem Text="DBbak_3" Value="DBbak_3.bak"></asp:ListItem>
				</asp:DropDownList>
				<asp:Button ID="btnBackUp" runat="server" Text="开始备份" onclick="btnBackUp_Click" />
				<asp:Button ID="btnRestore" runat="server" Text="恢复备份" onclick="btnRestore_Click" />
				<asp:Button ID="btnDownloadBak" runat="server" Text="下载备份" onclick="btnDownloadBak_Click" />
				<input type="button" onclick="document.getElementById('uploadPart').style.display='';" value="上传备份" class="input_Button" />
				<asp:Literal ID="ltMsg_Bak" runat="server"></asp:Literal>
			</p>
			<div id="uploadPart" style="display:none;padding:10px;">
				选择备份文件：<asp:FileUpload ID="FileUpload1" runat="server" />
				<asp:Button ID="btnUploadBak" runat="server" Text="上传" onclick="btnUploadBak_Click" />
				<input type="reset" value="取消" onclick="document.getElementById('uploadPart').style.display='none';" class="input_Button" />
			</div>
			<div>
				<fieldset title="数据库查询">
					<legend>数据库查询</legend>
					<table>
						<col width="65%" />
						<col width="35%" />
						<tr>
							<td>
								<asp:TextBox ID="tbQuery" runat="server" TextMode="MultiLine" Height="69px" Width="100%" CssClass="leftFloat"></asp:TextBox>
							</td>
							<td>
								<asp:RadioButtonList ID="rbtnlQueryType" runat="server" CssClass="leftFloat">
									<asp:ListItem Text="ExecuteNonQuery(返回受影响行数)" Value="ExecuteNonQuery" Selected="True"></asp:ListItem>
									<asp:ListItem Text="ExecuteScalar(返回首行首列)" Value="ExecuteScalar"></asp:ListItem>
									<asp:ListItem Text="ExecuteReader(返回结果集)" Value="ExecuteReader"></asp:ListItem>
								</asp:RadioButtonList>
							</td>
						</tr>
					</table>
				</fieldset>
				<asp:Button ID="btnExecuteQuery" runat="server" Text="执行查询" onclick="btnExecuteQuery_Click" />
				<asp:Panel ID="pnlQueryResult" runat="server"></asp:Panel>
			</div>
		</div>
    </div>
    </form>
</body>
</html>
